<template>
  <div class="bookinfo">
    <div class="thumb">
    <img class="bg" :src="info.image" mode="aspectFill">
    <img class="img" :src="info.image" mode="aspectFit">
    </div>
    <div class="info">
      <div class="title">{{info.title}}</div>
      <div class="author">{{info.author}}</div>
    </div>
    <div class="detail">
      <img class="avatar" :src="userInfo.image" mode="aspectFit"/>
      {{userInfo.nickName}}
      <div class="right text-primary">
        {{info.rate}}
        <Rate :value="info.rate"></Rate>
      </div>
    
    </div>
    <div class="detail">
      {{info.publisher}}
      <div class="rigth">{{info.price}}</div>
    </div>
    <div class="tags">
      <p class="badge" v-for="(tag,i) in userInfo.tags" :key="i">{{tag}}</p>
    </div>
    <div class="summary">
      <p v-for="(sum,i) in userInfo.summary" :key="i">{{sum}}</p>
    </div>
  </div>
</template>
<script>
import Rate from '@/components/Rate'
export default {
  props: ['info'],
  components: {
    Rate
  },
  computed: {
    userInfo () {
      return this.info.user_info || {}
    }
  }
}
</script>
<style lang="scss">
.bookinfo {
  font-size: 15px;
  .tags{
    margin-bottom: 5px;
    .badge{
    display: inline-block;
    border-radius: 10px;
    border: 1px solid #ea5a49;
    color: #ea5a49;
    margin: 5px;
    padding: 5px;
  }
  }
  .summary{
    padding: 5px;
    p{
      text-indent: 2em;
      font-size: 15px;
    }
  }
  .right {
    float: right;
  }
  .owner {
    padding: 20rpx;
    font-size: 28rpx;
  }
  .detail{
     padding: 20rpx;
    .avatar{
      width: 40rpx;
      height: 40rpx;
      border-radius: 50%;
      vertical-align: middle;
    }
  }
  .info {
      position: absolute;
      width: 100%;
      left: 0;
      top: 350rpx;
      text-align: center;
      .title {
        font-size: 30rpx;
      }
      .author {
        font-size: 24rpx;
      }
    }
  .thumb {
    position: relative;
    .bg {
      width: 750rpx;
      height: 500rpx;
      filter: blur(15px);
    }
    .img {
      position: absolute;
      left: 0;
      top: 30rpx;
      height: 300rpx;
      width: 100%;
    }
  }
}
</style>
